package com.fishery.monitor.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fishery.monitor.mapper.MonitorBaseMapper;
import com.fishery.monitor.mapper.MonitorEquipmentMapper;
import com.fishery.monitor.pojo.Equipment;
import com.fishery.monitor.pojo.MonitorBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
@Component
public class EquipmentDao {

    @Autowired
    MonitorEquipmentMapper monitorEquipmentMapper;


    public IPage<Equipment> findAll(Page<Equipment> page, QueryWrapper<Equipment> wrapper) {
        return  monitorEquipmentMapper.selectPage(page,wrapper);
    }

    public List<Equipment> findAll(QueryWrapper<Equipment> wrapper) {
        return  monitorEquipmentMapper.selectList(wrapper);
    }

    public Equipment findById(String id) {
        return (Equipment)this.monitorEquipmentMapper.selectById(id);
    }

    public void update(Equipment equipment) {
        this.monitorEquipmentMapper.updateById(equipment);
    }
}
